<?

class graphInterfaceNUPackets extends graphBase {
	public function __construct($device,$params=array()) {
		if (is_array($params) || is_object($params)) {
			foreach ($params AS $name=>$value) {
				switch ($name) {
					case 'index': 
						$this->rrdFile = 'interface_'.(int)$value.'.rrd';
						break;
				}
			}
		}
		parent::__construct($device,$params);
	}
	
	protected function getOptions() {
		return array(
			'DEF:out='.$this->rrdPath.':OUTNUCASTPKTS:AVERAGE',
			'DEF:in='.$this->rrdPath.':INNUCASTPKTS:AVERAGE',
			'DEF:out_max='.$this->rrdPath.':OUTNUCASTPKTS:MAX',
			'DEF:in_max='.$this->rrdPath.':INNUCASTPKTS:MAX',
			'CDEF:dout_max=out_max,-1,*',
			'CDEF:dout=out,-1,*',
			'CDEF:both=in,out,+',
			'AREA:in#AA66AA:',
			'AREA:dout#FFDD88:',
			'LINE1.25:dout#FF6600:Out','GPRINT:out:LAST:%6.2lf%s','GPRINT:out:AVERAGE:%6.2lf%s','GPRINT:out_max:MAX:%6.2lf%s\n',
			'LINE1.25:in#330033:In ','GPRINT:in:LAST:%6.2lf%s','GPRINT:in:AVERAGE:%6.2lf%s','GPRINT:in_max:MAX:%6.2lf%s\n',
			'COMMENT:Packets    Now      Ave      Max\n'
		);
	}
}